<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr=[]
        let sum = 0
        for(let i=1;i<=5;i++){
            arr.push(+prompt(`请输入第${i}个数`));
            if(arr[i]<0 && arr[i]>100)
                alert(`${arr[i]}不在范围内`)
        }
        for(let i=0;i<arr.length;i++){
            if(arr[i]>=18)
                document.write(`${arr[i]}<br/>`)
            sum = sum + arr[i]
        }
        document.write(`${sum}<br/>`)
        document.write(`${sum / arr.length}<br/>`)
        let max = arr[0]
        for(let i=0;i<arr.length;i++){
            if(arr[i+1]>arr[i]){
                max=arr[i+1]
            }
        }
        document.write(`${max}<br/>`)
        let min = arr[0]
        for (let i=0;i<arr.length;i++){
                if (arr[i + 1] < arr[i]) {
                    min = arr[i + 1]
                }
        }
        document.write(`${min}<br/>`)
    </script>
</body>
</html>